<template>
  <div class="article-item">
    <van-cell :to="'/article/'+article.art_id" :title="article.title">
      <!-- 自定义标题区域 -->
      <div slot="label" class="custom-label">
        <div v-if="article.cover.type===3" class="cover-images">
          <van-image v-for="(item,index) of article.cover.images" :key="index" fit="cover" :src="item" />
        </div>
        <span>{{article.aut_name}}</span><span>{{article.comm_count}}评论</span><span>{{article.pubdate|formatDate}}</span>
      </div>
      <!-- <div slot="default">1111</div> -->
      <van-image v-if="article.cover.type===1" class="right-image" fit="contain" :src="article.cover.images[0]" />
    </van-cell>
  </div>
</template>

<script>
export default {
  name: 'articleItem',
  // 父向子传值
  props: {
    article: {
      type: Object,
      required: true
    }
  },
  data () {
    return {}
  },
  methods: {},
  computed: {},
  watch: {},
  filters: {},
  components: {},
  created () { },
  mounted () { }
}
</script>

<style scoped lang='less'>
.article-item {
  // 自定义lable插槽
  .van-cell__value {
    flex: unset;
  }
  .custom-label {
    font-size: 23px;
    color: #999;
    span:nth-of-type(2) {
      display: inline-block;
      margin: 24px 10px;
    }
    // 三张图片封面
    .cover-images {
      display: flex;
      margin: 35px 0;
      .van-image {
        width: 232px;
        height: 146px;
        &:nth-child(2) {
          margin-left: 3px;
          margin-right: 3px;
        }
      }
    }
  }
  // 自定义内容插槽
  .right-image {
    width: 232px;
    height: 146px;
  }
}
</style>
